﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyMat
{
    public enum VectorKind {FLAT,VERTICAL};
    public class MyVector
    {
        double[] date;
        public VectorKind kind=VectorKind.FLAT;
        public double[] Date
        {
            get { return date; }
            set { date = value; }
        }
        public static MyVector operator +(MyVector one, MyVector another)
        {
            if (one.date.Length!=another.date.Length)
                return null;
            MyVector resVector=new MyVector();
            int length = one.date.Length;
            double[] resdate =new double[length];
            for (int i = 0; i < length; ++i)
                resdate[i] = one.date[i] + another.date[i];
            resVector.date = resdate;
            return resVector;
        }
        public static MyVector operator-(MyVector one, MyVector another)
        {
            if (one.date.Length != another.date.Length)
                return null;
            MyVector resVector = new MyVector();
            int length = one.date.Length;
            double[] resdate = new double[length];
            for (int i = 0; i < length; ++i)
                resdate[i] = one.date[i]-another.date[i];
            resVector.date = resdate;
            return resVector;
        }
        public static MyVector operator *(double k, MyVector another)
        {
            MyVector resVector = new MyVector();
            int length = another.date.Length;
            double[] resdate = new double[length];
            for (int i = 0; i < length; ++i)
                resdate[i] = k*another.date[i];
            resVector.date = resdate;
            return resVector;
        }
        public static MyVector operator /(MyVector another,double k)
        {
            MyVector resVector = new MyVector();
            int length = another.date.Length;
            double[] resdate = new double[length];
            for (int i = 0; i < length; ++i)
                resdate[i] = another.date[i]/k;
            resVector.date = resdate;
            return resVector;
        }
       
    }
}
